package com.zjuee.base.dto.common.auth;

import com.zjuee.base.base.Converter;
import com.zjuee.base.model.common.auth.UserRole;
import lombok.*;
import org.springframework.beans.BeanUtils;

/**
 * @author wu liang
 * @since 1.0
 */
@Data
@NoArgsConstructor
//@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class UserRoleDto extends UserRole implements Converter<UserRole, UserRoleDto> {

    @Override
    public void convertToDo(UserRole userRole) {
        BeanUtils.copyProperties(this, userRole);
    }

    @Override
    public UserRoleDto convert(UserRole userRole) {
        BeanUtils.copyProperties(userRole, this);
        return this;
    }
}
